const util = require('../../../../utils/util.js');
const api = require('../../../../config/api.js');
const user = require('../../../../services/user.js');

//获取应用实例
const app = getApp()
Page({
  data: {
    finishTasks: []
  },
  onShareAppMessage: function () {
    return {
      title: 'CRMP',
      desc: '化学试剂管理平台',
      path: '/pages/index/index'
    }
  },onPullDownRefresh(){
	  	// 增加下拉刷新数据的功能
	    var self = this;
	    this.getIndexData();
 },
  getIndexData: function () {
    let that = this;
    var data = new Object();
    util.request(api.FinishTaskList).then(function (res) {
      if (res.code === 0) {
        data.finishTasks= res.tmFinishTaskEntityList
      that.setData(data);
      }
    });

  },
  onLoad: function (options) {
    this.getIndexData();
  },
  onReady: function () {
    // 页面渲染完成
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  },
})
